-
Notifications
You must be signed in to change notification settings - Fork 194
Add non-streaming response to approximate prefix cache. #1719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
e21b3fe to
565a1ce
Compare
a7ddc30 to
7476ad3
Compare
e1f9e73 to
eec941c
Compare
|
/assign @liu-cong |
eec941c to
824af68
Compare
…ethod of Messages in ChatCompletions.
824af68 to
39ae663
Compare
| // MarshalMessagesToJSON converts a slice of Message structs into a JSON byte slice. | ||
| // This is used to create a consistent byte representation for prefix caching calculations, | ||
| // allowing us to identify common prefixes between LLM requests and responses. | ||
| func MarshalMessagesToJSON(messages ...Message) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think this belongs in the llmresponse.go file, or potentially out of the types package altogether
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kfswain, zetxqx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add non streaming response to prefix cache, several points to pay attention:
requestcontrolplugin into 3 separate plugins to add streamed request functionality #1661ResponseCompleteto accept a*types.LLMResponsewhich has richer structure.ChatCompletionsmessages for prefix caching is now standardized viaMarshalMessagesToJSONto improve caching accuracy for multi-turn conversations.Which issue(s) this PR fixes:
Fixes Partially #971
Does this PR introduce a user-facing change?: